<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j">
<head>
<title>#{bundle.painelprof}</title>
</head>
<body>
	<div id="accordion4">
		<rich:simpleTogglePanel label="#{bundle.painelcadprof}"
			switchType="client">
			<div>
				<div>
					<h:form id="cadpro">
				#{bundle.painelnome}<br />
						<h:inputText required="true" id="nameP" size="60" value="#{pUserBean.nome}">
							<f:validator validatorId="chaveValidator" />
							<f:attribute name="tipo" value="Usuario" />
						</h:inputText>
						<h:message for="nameP" style="color: blue;font-weight: bold;margin-left: 10px;" />
						<br />
				#{bundle.painellogin}<br />
						<h:inputText required="true" id="userP" value="#{pUserBean.login}">
							<f:converter converterId="KeyLowerCaseConverter"/>
						</h:inputText>
						<h:message for="userP" style="color: blue;font-weight: bold;margin-left: 10px;" />
						<br />
				#{bundle.painelsenha}<br />
						<h:inputText required="true" id="passP" value="#{pUserBean.senha}">
							<f:validateLength minimum="5" />
							<f:converter converterId="HashSenhaConverter"/>
						</h:inputText>
						<h:message for="passP" style="color: blue;font-weight: bold;margin-left: 10px;" />
						<br />
						<br />
						<h:commandButton value="#{bundle.painelcad}" action="#{pUserBean.cadastrar}">
							<f:setPropertyActionListener value="Professor"
								target="#{pUserBean.tipo}" />
						</h:commandButton>
					</h:form>
				</div>
			</div>
		</rich:simpleTogglePanel>
		<rich:simpleTogglePanel label="#{bundle.painelverprof}"
			switchType="client">
			<div>
				<div>
					<h:form>
						<h:dataTable bgcolor="#F8F8FF" cellpadding="10px" width="100%"
							rowClasses="tr_listapainel" styleClass="table_listapainel"
							var="prof" headerClass="head_listacurso" id="dtpanpro"
							value="#{pUserBean.listaProfessores}">
							<h:column>
								<f:facet name="header">
									<h:outputText>
										<b>#{bundle.painellogin}</b>
									</h:outputText>
								</f:facet>
								<h:outputFormat value="#{prof.login}" />
							</h:column>
							<h:column>
								<f:facet name="header">
									<h:outputText>
										<b>#{bundle.painelhashsenha}</b>
									</h:outputText>
								</f:facet>
								<h:outputFormat value="#{prof.senha}" />
							</h:column>
							<h:column>
								<f:facet name="header">
									<h:outputText>
										<b>#{bundle.painelnome}</b>
									</h:outputText>
								</f:facet>
								<h:outputFormat value="#{prof.nome}" />
							</h:column>
							<h:column>
								<f:facet name="header">
									<h:outputText>#{bundle.painelacoes}</h:outputText>
								</f:facet>
								<a4j:commandButton action="#{eUserBean.carregar}" value="#{bundle.paineleditar}" id="atualProf"
									 oncomplete="Richfaces.showModalPanel('panelPro')" reRender="nomePro,loginPro,passPro,chk_pro">
									<f:setPropertyActionListener value="#{prof}"
										target="#{eUserBean.atual}" />									
								</a4j:commandButton>
								<h:commandButton action="#{pUserBean.deletar}" value="#{bundle.painelexcluir}"
									onclick="return confirm('#{bundle.paineloconfirmexcluirprof}');">
									<f:setPropertyActionListener value="#{prof.login}"
										target="#{pUserBean.logDel}" />
									<f:setPropertyActionListener value="Professor"
										target="#{pUserBean.tipo}" />
								</h:commandButton>
							</h:column>
						</h:dataTable>
					</h:form>
					<f:subview id="editaprof">
						<ui:include src="/editarprofessor.xhtml" />
					</f:subview>
				</div>
			</div>
		</rich:simpleTogglePanel>
	</div>
</body>
</html>